package com.cloudbroker.bcs.common.model;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xuyn15828 on 2016/3/16.
 */
public class PageArticle {
    /** 文章标题 */
    private String title;
    /** 摘要 */
    private String summary;
    /** 首张图片路径 */
    private String imgUrl;

    private List<String> urlList = new ArrayList<>();

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<String> getUrlList() {
        return urlList;
    }

    public void setUrlList(List<String> urlList) {
        this.urlList = urlList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("imgUrl", imgUrl)
                .append("title", title)
                .append("summary", summary)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        PageArticle article = (PageArticle) o;

        return new EqualsBuilder()
                .append(title, article.title)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(title)
                .toHashCode();
    }
}
